﻿// <copyright file="Phone.cs" company="Microsoft Corporation">
// Copyright (c) 2009 Microsoft Corporation All Rights Reserved
// </copyright>
// <author>Michael S. Scherotter</author>
// <email>mischero@microsoft.com</email>
// <date>2008-10-09</date>
// <summary>OpenSocial Phone number</summary>

namespace opensocial
{
    using System.Windows.Browser;
    using Synergist;

    /// <summary>
    /// OpenSocial Phone number
    /// </summary>
    public class Phone
    {
        /// <summary>
        /// Initializes a new instance of the Phone class.
        /// </summary>
        public Phone()
        {
        }

        /// <summary>
        /// Initializes a new instance of the Phone class.
        /// </summary>
        /// <param name="scriptObject">the JavaScript opensocial.Phone object</param>
        public Phone(ScriptObject scriptObject)
        {
            this.Number = scriptObject.getField("opensocial.Phone.Field.NUMBER") as string;

            this.NumberType = scriptObject.getField("opensocial.Phone.Field.TYPE") as string;
        }

        /// <summary>
        /// Gets or sets the phone number
        /// </summary>
        public string Number { get; set; }

        /// <summary>
        /// Gets or sets the phone number type or label
        /// </summary>
        public string NumberType { get; set; }

        /// <summary>
        /// Gets the properties for the object
        /// </summary>
        /// <returns>a string listing the non-null properties and their values.</returns>
        public override string ToString()
        {
            return Synergist.Utility.GetProperties(this);
        }
    }
}
